package com.bsi.app;

import android.widget.Toast;

public abstract class OnBackPressedExitActivity extends BaseActivity implements IHasTitleBar {

	
	/**
	 * 按返回键退出app
	 */
	long waitTime = 2000;
	long touchTime = 0;
	@Override
	public void onBackPressed() {
		long currentTime = System.currentTimeMillis();
		if ((currentTime - touchTime) >= waitTime) {
			Toast.makeText(this, "再按一次退出", Toast.LENGTH_SHORT).show();
			touchTime = currentTime;
		} else {
			com.bsi.app.AppManager.getAppManager().finishAllActivity();
			
		}
	}
	
}
